$("#search").click(function(){
    if(ajaxFun("/ajax/checkAuthority/?functionId=web_release_qry&deptId=")){
        var applicant = $("#applicant").val();
        var approval_person = $("#approval_person").val();
        var car_num   = $("#car_num").val();
        var date_start = $("#date_start").val();
        var date_end = $("#date_end").val();
        var state =$('input:radio[name="state"]:checked').attr("value")==undefined?null:$('input:radio[name="state"]:checked').attr("value");
        if(!checkEndTime(date_start,date_end)){
            show_err_msg("审批日期的结束时间应大于开始时间!");
            return false;
        }
        window.location = "/release/?applicant="+applicant+"&approval_person="+approval_person+"&car_num="+car_num+"&date_end="+date_end
                          +"&date_start="+date_start+"&state="+state;

    }else{
        show_err_msg("您目前没有查询放行的权限,请联系管理员"); 
    }
});
function release(vehicleId,vin){
    if(ajaxFun("/ajax/checkAuthority/?functionId=web_release_apply&deptId=")){
        if(confirm("确定放行"+vin+"么？")){
    	    $.post("/ajax/release/",{"vehicleId":vehicleId},function(data){
    	       if(data.status == "fail"){
                    show_err_msg(data.info);
                }else if(data.status == "succeed"){
                    show_msg(data.info,'/release/');
                }
    	    });
        }else{
        	return false;
        }
    }else{
        show_err_msg("您目前没有批准放行的权限,请联系管理员"); 
        return false;
    }
}